package com.byit.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.byit.domain.SysMessageNotice;
import com.byit.mapper.SysMessageNoticeMapper;
import com.byit.service.ISysMessageNoticeService;
import com.byit.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName SysMessageNoticeServiceImpl
 * @Description TODO
 * @Author lxp
 * @Date 2019-01-24 17:01
 **/


@Service
public class SysMessageNoticeServiceImpl extends ServiceImpl<SysMessageNoticeMapper, SysMessageNotice> implements ISysMessageNoticeService {

    @Autowired
    private SysMessageNoticeMapper mapper;

    @Override
    public void delSysMessageNoticeById(Map<String, Object> params) {

         mapper.delSysMessageNoticeById(params);
    }

    @Override
    public Page<JSONObject> selectSysMessageNoticeAll(Page<SysMessageNotice> pageInfo, Map<String, Object> params) {
        List<JSONObject> list = mapper.selectSysMessageNoticeAll(pageInfo, params);
        Page<JSONObject> page = PageUtil.transform(pageInfo);

        page.setRecords(list);

        return page;
    }

    @Override
    public List<JSONObject> selectInfoByConmpanyAndUserID(Map<String, Object> params) {
        List<JSONObject> list = mapper.selectInfoByConmpanyAndUserID( params);

        return list;
    }
}
